﻿namespace EyeOpen.Crypt.Web
{
    using System;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
    using EyeOpen.Crypt.Web;
    using EyeOpen.IO;

    [EnableClientAccess]
    public class EncryptDomainService : DomainService
    {
        public EncryptionMessage CryptDecrypt(string key, string source)
        {
            var encryptionResult = new EncryptionService().CryptDecrypt(key, source);

            var encryptionMessage =
                new Converter()
                    .Convert(encryptionResult);

            encryptionMessage.Id = Guid.NewGuid();

            return encryptionMessage;
        }
    }
}


